package com.csdj.springcloudt309.order.service;


import com.csdj.spingcloudt309.common.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 远程调用user模块的接口
 */
@Component
@FeignClient(name = "user",fallback = UserServiceRpcFallback.class)
public interface UserServiceRpc {

    @GetMapping("/user/info/{id}")
    User getUserInfo(@PathVariable("id")Integer id);

    @PutMapping("/user/add")
    int saveUser(@RequestBody User user);
}
